From 85c8c8637722689e07bd1d68dc6dd4fa7b3f0b73 Mon Sep 17 00:00:00 2001 From: robertl Date: Tue, 8 Sep 2009 00:29:09 +0000 Subject: [PATCH] Don't ship -w -t -r unless boht input and output can handle them. --- gui/mainwindow.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index c56e60a4a..10a05f64b 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -// $Id: mainwindow.cpp,v 1.8 2009/09/07 18:47:55 robertl Exp $ +// $Id: mainwindow.cpp,v 1.9 2009/09/08 00:29:09 robertl Exp $ //------------------------------------------------------------------------ // // Copyright (C) 2009 S. Khai Mong . @@ -731,9 +731,15 @@ void MainWindow::applyActionX() if (bd.enableCharSetXform && bd.inputCharSet != QString()) args << "-c" << bd.inputCharSet; - if (bd.xlateWayPts) args << "-w"; - if (bd.xlateRoutes) args << "-r"; - if (bd.xlateTracks) args << "-t"; + Format ifmt = formatList[currentComboFormatIndex(ui.inputFormatCombo)]; + Format ofmt = formatList[currentComboFormatIndex(ui.outputFormatCombo)]; + + if (bd.xlateWayPts && ifmt.isReadWaypoints() && ofmt.isWriteWaypoints()) + args << "-w"; + if (bd.xlateRoutes && ifmt.isReadRoutes() && ofmt.isWriteRoutes()) + args << "-r"; + if (bd.xlateTracks && ifmt.isReadTracks() && ofmt.isWriteTracks()) + args << "-t"; // Input type, with options bool iisFile = (bd.inputType == BabelData::fileType); -- 2.30.2